package com.my.study.hutool.annotation;

import cn.hutool.core.annotation.AnnotationUtil;

/**
 * @author: yidujun
 * @create: 2021/06/29 16:51
 */
public class Test {

    public static void main(String[] args) {
        Object value = AnnotationUtil.getAnnotationValue(ClassWithAnnotation.class, AnnotationForTest.class);
        System.out.println(value);

        // 修改注解内容
        AnnotationForTest annotationForTest = AnnotationUtil.getAnnotation(ClassWithAnnotation.class, AnnotationForTest.class);
        AnnotationUtil.setValue(annotationForTest, "value", "test");
        System.out.println(AnnotationUtil.getAnnotationValue(ClassWithAnnotation.class, AnnotationForTest.class).toString());

    }

}
